package com.jzo2o.customer.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jzo2o.customer.model.domain.WorkerCertificationAudit;
import com.jzo2o.customer.model.dto.request.WorkerCertificationAuditPageQueryReqDTO;
import com.jzo2o.customer.model.dto.response.WorkerCertificationAuditResDTO;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface WorkerCertificationAuditMapper extends BaseMapper<WorkerCertificationAudit> {

    /**
     * @param dto
     * @return
     * @author XingDong
     */
    List<WorkerCertificationAuditResDTO> selectByPage(WorkerCertificationAuditPageQueryReqDTO dto);

    /**
     * @param serveProviderId
     * @return
     * @author XingDong
     */
    @Select("select reject_reason from worker_certification_audit where serve_provider_id = #{serveProviderId} order by create_time desc limit 1 ")
    WorkerCertificationAuditResDTO selectByServeProviderId(Long serveProviderId);
}
